package es.aa.android.cartomatic.customview;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import es.aa.android.cartomatic.R;
import es.aa.android.cartomatic.domain.Card;

public class CardView extends RelativeLayout {

	private Context context;
	private Card card;
	private TextView title;
	private TextView description;
	private ImageView image;
	
	public CardView(Context context) {
		super(context);
	}
	
	public CardView(Context context, Card card) {
		super(context);
		this.context = context;
		this.card = card;
		init();
	}
	
	private void init() {
		LayoutInflater.from(context).inflate(R.layout.card, this, true);
		title = (TextView) findViewById(R.id.textViewTitle);
		image = (ImageView) findViewById(R.id.imageView);
		description = (TextView) findViewById(R.id.textViewSubtitle);
		setParams();
	}
	
	public Card getCard() {
		return card;
	}
	
	private void setParams() {
		title.setText(card.getId() + " " + card.getName());
	}

}
